import request from "@/utils/request.js"

/**
 * @param {Object} data
 */
export function getMessage(data) {
	return request({
		url: "/app/message/list",
		method: "GET",
		params: data,
	})
}

/**
 * 获取未读信息数
 * @param {Object} data
 */
export function getUnreadCount(data) {
	return request({
		url: "/app/message/getUnreadCount",
		method: "GET",
		params: data,
	})
}

/**
 * 修改未读状态
 */
export function setMessageRead(data) {
	return request({
		url: "/app/message/update",
		method: "POST",
		params: data,
	})
}

/**
 * 账号密码登录
 */
export function login(data) {
	return request({
		url: "/login",
		method: "POST",
		params: data,
	})
}

/**
 * 获取用户信息
 */
export function getUserInfo() {
	return request({
		url: "/getInfo",
		method: "GET"
	})
}

/**
 * 意见反馈
 */
export function createFeedback(data) {
	return request({
		url: "/app/feedback",
		method: "POST",
		params: data
	})
}

export function updatePassword(data) {
	return request({
		url: "/system/user/profile/updatePwd?oldPassword=" + data.oldPassword + "&newPassword=" + data.newPassword,
		method: "POST",
	})
}